perf(refit): batch MXFP8 expert prequantization - #3804
Draft
seonjinn wants to merge 104 commits into
Draft
Conversation
Reduce MXFP8 and ModelOpt refit overhead while preserving transport and checkpoint-engine lifecycle correctness. Signed-off-by: sna <sna@nvidia.com>
Signed-off-by: sna <sna@nvidia.com>
Signed-off-by: sna <sna@nvidia.com>
Signed-off-by: sna <sna@nvidia.com>
Signed-off-by: sna <sna@nvidia.com>
Signed-off-by: sna <sna@nvidia.com>
Signed-off-by: sna <sna@nvidia.com>
Signed-off-by: sna <sna@nvidia.com>
Signed-off-by: sna <sna@nvidia.com>
Signed-off-by: sna <sna@nvidia.com>
…optimization-squashed # Conflicts: # nemo_rl/algorithms/grpo.py
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
…timization-squashed Signed-off-by: seonjinn <sna@nvidia.com>
…optimization-squashed Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
…optimization-squashed Signed-off-by: seonjinn <sna@nvidia.com>
…optimization-squashed Signed-off-by: seonjinn <sna@nvidia.com> # Conflicts: # nemo_rl/models/generation/vllm/quantization/fp8.py # tests/unit/models/generation/test_vllm_fp8_quantization.py
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
…optimization-squashed
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Contributor
Author
|
/ok to test 1c9e4b5 |
…60904 Signed-off-by: seonjinn <sna@nvidia.com> # Conflicts: # nemo_rl/algorithms/grpo.py # nemo_rl/weight_sync/collective_weight_synchronizer.py # nemo_rl/weight_sync/interfaces.py # tests/unit/models/generation/test_vllm_fp8_quantization.py
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Signed-off-by: seonjinn <sna@nvidia.com>
Use the replayed PR NVIDIA-NeMo#3804 tree on the latest PR NVIDIA-NeMo#3294 and main integration. Signed-off-by: seonjinn <sna@nvidia.com>
Contributor
Author
|
Self-review completed on head Reviewed the six-file change on top of #3294, including numerical behavior, refit wire order, CUDA stream handoffs, temporary-buffer lifetime, configuration guards, and fallback paths. No blocking correctness, compatibility, security, or deadlock issue was found. Key checks:
Validation on GB200:
The current-head Qwen3-30B-A3B 20-step performance A/B and Qwen3-235B peak-memory validation are still pending, so the PR remains a draft. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Batch matching MoE expert weights before trainer-side MXFP8 prequantization. The path quantizes at most 16 experts per call, preserves the original refit wire order, and reuses temporary stacking storage only within one export pass.
Non-expert weights and expert groups that cannot be batched keep the existing per-tensor path.
fp8_param=trueis rejected because this path requires BF16 source weights.This PR builds on #3294. Async NCCL Reshard receiver-side conversion is separate and is not changed here.
Why
The existing path launches one quantization operation per expert tensor. Large MoE models repeat this operation hundreds of times per refit. Batching compatible experts reduces launch and synchronization overhead without changing the value/scale payload consumed by vLLM.
Evidence
Prior Qwen3-30B-A3B prototype on GB200, synchronous colocated GRPO with CUDA Graph, 20 steps:
Generation KL error was unchanged at
0.00398.Current head
cfbe773c70a61f55835e6ed15339c61e3ae844ed:Qwen3-235B peak-memory and end-to-end validation remain before this PR is ready for review.